package com.nervenets.shopping.hibernate.domain.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.shopping.enumeration.Gender;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@EqualsAndHashCode(callSuper = true)
@Entity
@Table
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserWxId extends DomainObject {
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(columnDefinition = "user_id")
    @JsonIgnore
    @JSONField(serialize = false)
    protected User user;
    @ApiModelProperty(value = "微信appId")
    private String appId;
    @ApiModelProperty(value = "微信openId")
    private String openId;
    @ApiModelProperty(value = "微信昵称")
    private String nickName;
    @ApiModelProperty(value = "微信头像")
    private String avatar;
    @ApiModelProperty(value = "微信性别")
    private Gender gender;
}
